<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStoreDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('store_details', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('store_id')->index()->comment('门店ID');
            $table->string('name', '20')->index()->comment('门店名称');
            $table->text('logo_url')->nullable()->comment('门店logo图片url');
            $table->string('mobile', 20)->index()->nullable()->comment('联系方式');
            $table->string('province', 255)->index()->nullable()->comment('店铺地址-省份');
            $table->string('city', 255)->index()->nullable()->comment('店铺地址-城市');
            $table->string('county', 255)->index()->nullable()->comment('店铺地址-区/县');
            $table->string('address', 255)->nullable()->comment('店铺地址-详细地址');
            $table->string('lat', 255)->nullable()->comment('位置信息纬度');
            $table->string('lng', 255)->nullable()->comment('位置信息经度');
            $table->integer('business_time_start')->index()->nullable()->comment('营业开始时间戳');
            $table->integer('business_time_end')->index()->nullable()->comment('营业结束时间戳');
            $table->text('details')->nullable()->comment('商品详情html');
            $table->integer('status')->index()->default(1)->comment('状态：1.正常，2.禁用');
            $table->engine = 'InnoDB';
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('store_details');
    }
}
